package com.cody.service.impl;

import com.cody.dao.CommentDao;
import com.cody.entity.Comment;
import com.cody.service.CommentService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Cody
 * @date 2021/4/9 - 21:15
 */
@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentDao commentDao;

    @Override
    public List<Comment> queryAllComment() {
        return commentDao.queryAllComment();
    }

    @Override
    public List<Comment> queryAllCommentByQuestionId(Integer questionId) {
        return commentDao.queryAllCommentByQuestionId(questionId);
    }

    @Override
    public  List<Comment> queryCommentByKeyword(String keyword) {
        return commentDao.queryCommentByKeyword(keyword);
    }

    @Override
    public List<Comment> queryAllCommentByNumber(String number) {
        return commentDao.queryAllCommentByNumber(number);
    }

    @Override
    public Comment queryCommentByCommentId(Integer commentId) {
        return commentDao.queryCommentByCommentId(commentId);
    }

    @Override
    public boolean insertComment(Comment comment) {
        return commentDao.insertComment(comment);
    }

    @Override
    public boolean delCommentByCommentId(Integer commentId) {
        return commentDao.delCommentByCommentId(commentId);
    }

    @Override
    public boolean updCommentInfo(Comment comment) {
        return commentDao.updCommentInfo(comment);
    }


}
